package cn.usian.feign.client;

import cn.usian.feign.pojo.User;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("userservice")
public interface UserClient {

    @GetMapping("user/page")
    public Page<User> findPage(@RequestParam(required = true,defaultValue = "1")Integer pageIndex, @RequestParam("name") String name);

    @PostMapping("user/add")
    public String addUser(@RequestBody User user);

    @GetMapping("user/del")
    public String del(@RequestParam("id") Long id);

    @GetMapping("user/findById")
    public User findById(@RequestParam("id") Long id);

    @PostMapping("user/edit")
    public String edit(@RequestBody User user);
}
